﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Orientation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
    x:Class="Orientation.MainPage"
    mc:Ignorable="d">
    <Page.DataContext>
        <local:ViewModel/>
    </Page.DataContext>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    	<Interactivity:Interaction.Behaviors>
    		<Core:DataTriggerBehavior x:Name="LandscapeDataTriggerBehavior" Binding="{Binding Orientation}" Value="Landscape">
    			<Core:GoToStateAction x:Name="LandscapeGoToStateAction" StateName="LandscapeState"/>
    		</Core:DataTriggerBehavior>
    		<Core:DataTriggerBehavior x:Name="PortraitDataTriggerBehavion" Binding="{Binding Orientation}" Value="Portrait">
    			<Core:GoToStateAction x:Name="PortraitGoToStateAction" StateName="PortraitState"/>
    		</Core:DataTriggerBehavior>
    	</Interactivity:Interaction.Behaviors>
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="VisualStateGroup">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="0:0:1.8"/>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="LandscapeState"/>
				<VisualState x:Name="PortraitState">
					<Storyboard>
						<DoubleAnimation Duration="0" To="195.522" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="-280.597" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="-561.194" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="rectangle1" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="388.06" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="rectangle1" d:IsOptimized="True"/>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="170" Margin="70,79,0,0" Stroke="Black" VerticalAlignment="Top" Width="231"/>
		<Rectangle x:Name="rectangle" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="170" Margin="352,79,0,0" Stroke="Black" VerticalAlignment="Top" Width="231" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<CompositeTransform/>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle1" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="170" Margin="631,79,0,0" Stroke="Black" VerticalAlignment="Top" Width="231" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<CompositeTransform/>
			</Rectangle.RenderTransform>
		</Rectangle>

	</Grid>
</Page>
